<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>

<%@page import="java.util.*, model.*"%>
<%@ page import="javax.sql.*"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Process Not Started</title>
</head>

<body>
	Before you start the application process there are a few tasks you must first accomplish!
	
	<!-- in case validation of the entry data fails in the data bean -->
	<html:errors />

	<table>
	<tr>
		<td>
			<!-- Add an HTML table header row to format the results -->
			<table>
			<tr>
				<th>ID</th>
				<th>Username</th>
				<th>Password</th>
				<th>Action</th>
			</tr>
			<tr>
			<!--  TODO  ----------------------------------------------------------------------->
			  	<html:form action="/insertReviewer">
					<td>&nbsp;</td>
					<td><html:text property="username" size="15" /></td>
					<td><html:text property="password" size="15" /></td>
					<td><html:hidden property="email" value="null" /></td>
					<td><html:submit value="Add Reviewer" /></td>
				</html:form>
			</tr> 
			<ul>
			<%-- -------- Iteration Code -------- --%>
			<%
				// Get the studentsRowSet
				RowSet crsReviewers = (RowSet) session.getAttribute("crsReviewers");
				
				// Iterate over the RowSet
				while (crsReviewers.next()) {
			%>
			<tr>
				<td>	
					<li><%= crsReviewers.getString("user_name") %> </li>
				</td>
				<td>
					<% String username = crsReviewers.getString("user_name"); %>
					<html:form action="/DeleteReviewer">
						<html:hidden property="username" value="<%= username %>" />
						<html:submit value="Delete Reviewer" />
					</html:form>
				</td>
			</tr>
			<% } %>
			</ul>
			</table>
		</td>
	</tr>
	</table>
	<p><html:link action="/chairsHome">Home</html:link></p>
</body>
</html>